Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

John Hancock - RestaurantReviews implementation #48

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

hancock309
Copy link

This is not a complete implementation. I wanted to focus on demonstrating SOLID principals and writing code that is easy to test.

The projects are as follows:

  • RestaurantReviews.API
    • Main API entrypoint
    • Contains controllers for restaurant, review, and user
      • controllers only contain endpoints that were requested or that I needed to test
    • Dependency Injection setup is in Startup.cs
    • Contains json data for testing
  • RestaurantReviews.API.Tests
    • Contains unit tests for one controller and one model validator
    • Uses XUnit and Moq
  • RestaurantReviews.Business
    • Contains managers for restaurant, review, and user
      • Some input validation is done, but is definitely incomplete
        • Example: does not test to see if a user is submitting a duplicate review
    • Contains a Fluent model validator for reviews
      • Checks for empty review content, invalid restaurantId, and invalid userId
  • RestaurantReviews.Interfaces
    • Contains all of the interfaces
  • RestaurantReviews.JsonData
    • Concrete implementations of the repository interfaces
    • Not unit tested because this is only meant to demonstrate that the rest of the code works
  • RestaurantReviews.Models
    • Concrete implementations of the model interfaces
    • Models were kept as simple as possible

Notes:

  • I did not implement anything as async
  • I did not do much error handling

Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant